#ifndef __COMPONENT_SPRITE_HPP__
#define __COMPONENT_SPRITE_HPP__

#include "component.hpp"
#include "macro.hpp"
#include "SDL.h"
#include "app.hpp"
#include<memory>
#include<string>


class ComponentSprite : public Component
{
public:
    mb useTextureSrcRect;
    SDL_Rect textureSrcRect;
    SDL_Texture* texture;
    ComponentSprite( std::string const& path );
    ComponentSprite( SDL_Texture* texture );
    ComponentSprite();
    ~ComponentSprite();

    Component::CLASS getClassName() const {
        return CLASS::SPRITE;
    }

    void setTexture( std::string const& path, bool setNodeSize = true );

    void resizeNode();
    void visit( App& app );
    void draw( SDLView& view );
};

#endif // !__COMPONENT_SPRITE_HPP__
